### GENERATING TABLE B.3: LIST EXPERIMENT ATES

### USES PNAS DATASET

### REQUIRED PACKAGES
require(multiwayvcov)
require(lmtest)
require(stargazer)


#RUN ATES

enter.null <- lm(enterlist.pre ~ enterlist.pre.dum + factor(parish), data=pnas)
summary(enter.null)
enter.null.clust<-cluster.vcov(enter.null, pnas$ed.parish)
enter.null.mcse <- coeftest(enter.null, enter.null.clust)
enter.null.mcse
rownames(enter.null.mcse)[2] <- "Treat"

work.null <- lm(worklist.pre ~ worklist.pre.dum + factor(parish), data=pnas)
summary(work.null)
work.null.clust<-cluster.vcov(work.null, pnas$ed.parish)
work.null.mcse <- coeftest(work.null, work.null.clust)
work.null.mcse
rownames(work.null.mcse)[2] <- "Treat"

#for coefficients
stargazer(enter.null.mcse, work.null.mcse, align=TRUE, column.labels=c("Fake Documents", "Work as Tourist"), 
          omit.stat=c("LL","ser","f"), covariate.labels=c("Treatment Effect"), title="List Experiment Average Treatment Effect",single.row=FALSE)

#for n
stargazer(enter.null, work.null, align=TRUE, column.labels=c("Fake Documents", "Work as Tourist"), 
          omit.stat=c("LL","ser","f"), covariate.labels=c("Treatment Effect"), title="List Experiment Average Treatment Effect",single.row=FALSE)


